package com.mall.untils;
import java.io.IOException;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PropertiesUtil { 
	public static Logger logger = LoggerFactory.getLogger(PropertiesUtil.class);
	private static Properties p = new Properties();  
	private static Properties jdbc = new Properties(); 
    /** 
     * 读取properties配置文件信息 
     */  
    static{
        try {
            p.load(PropertiesUtil.class.getClassLoader().getResourceAsStream("data_processing.properties"));  
            jdbc.load(PropertiesUtil.class.getClassLoader().getResourceAsStream("jdbc.properties"));
        } catch (IOException e) {  
            e.printStackTrace();   
            logger.info("默认加载配置文件出错");
        }  
    }  
    /** 
     * 根据key得到value的值 
     */  
    
    public static String getProperties (String key){
		return p.getProperty(key);
	}
    public static String getJdbcProperties(String key){
    	return jdbc.getProperty(key);
    }
} 